package com.nuaa.shopping.mapper;

import java.sql.ResultSet;
import java.sql.SQLException;

import com.nuaa.shopping.entity.Product;
import com.nuaa.shopping.util.RowMapper;

public class ProductMapper implements RowMapper<Product> {

	@Override
	public Product mapRow(ResultSet rs) throws SQLException {
		Product p = new Product();
		p.setId(rs.getInt("id"));
		p.setName(rs.getString("name"));
		p.setPrice(rs.getDouble("price"));
		return p;
	}

}
